1 <?php include ( "../inc/connect.inc.php" ); ?>
2 <?php
3 ob_start();
4 session_start();

5 if
(!isset($_SESSION['admin_login'])) {
6     header(
"location: login.php");
7     $user =
"";
8 }

9 else
{
10     $user = $_SESSION[
'admin_login'];
11     $result = mysql_query(
"SELECT * FROM admin WHERE id='$user'");
12         $get_user_email = mysql_fetch_assoc($result);
13             $uname_db = $get_user_email[
'firstName'];
14 }
15
16 ?>
17
18
19 <!doctype html>
20 <html>
21     <head>
22         <title>Welcome to ebuybd online shop</title>
23         <link rel=
"stylesheet" type="text/css" href="../css/style.css">
24     </head>
25     <body
class="home-welcome-text" style="background-image: url(../image/homebackgrndimg2.png);">
26         <div
class="homepageheader">
27             <div
class="signinButton loginButton">
28                 <div
class="uiloginbutton signinButton loginButton" style="margin-right: 40px;">
29                     <?php
30                         
if ($user!="") {
31                             echo
'<a style="text-decoration: none;color: #fff;" href="logout.php">LOG OUT</a>';
32                         }
33                      ?>
34                     
35                 </div>
36                 <div
class="uiloginbutton signinButton loginButton">
37                     <?php
38                         
if ($user!="") {
39                             echo
'<a style="text-decoration: none;color: #fff;" href="login.php">Hi '.$uname_db.'</a>';
40                         }
41                         
else {
42                             echo
'<a style="text-decoration: none;color: #fff;" href="login.php">LOG IN</a>';
43                         }
44                      ?>
45                 </div>
46             </div>
47             <div style=
"float: left; margin: 5px 0px 0px 23px;">
48                 <a href=
"index.php">
49                     <img style=
" height: 75px; width: 130px;" src="../image/ebuybdlogo.png">
50                 </a>
51             </div>
52             <div
class="">
53                 <div id=
"srcheader">
54                     <form id=
"newsearch" method="get" action="http://www.google.com">
55                             <input type=
"text" class="srctextinput" name="q" size="21" maxlength="120" placeholder="Search Here..."><input type="submit" value="search" class="srcbutton" >
56                     </form>
57                 <div
class="srcclear"></div>
58                 </div>
59             </div>
60         </div>
61         <div
class="categolis">
62             <table>
63                 <tr>
64                     <th>
65                         <a href=
"index.php" style="text-decoration: none;color: #fff;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Home</a>
66                     </th>
67                     <th><a href=
"addproduct.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Add Product</a></th>
68                     <th><a href=
"newadmin.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">New Admin</a></th>
69                     <th><a href=
"allproducts.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">All Products</a></th>
70                     <th><a href=
"orders.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #24bfae;border-radius: 12px;">Orders</a></th>
71                 </tr>
72             </table>
73         </div>
74         <div>
75             <table
class="rightsidemenu">
76                 <tr style=
"font-weight: bold;" colspan="10" bgcolor="#4DB849">
77                     <th>Id</th>
78                     <th>User Id</th>
79                     <th>Product Id</th>
80                     <th>Q*P=T</th>
81                     <th>Order Place</th>
82                     <th>Mobile</th>
83                     <th>Order Status</th>
84                     <th>Order Date</th>
85                     <th>Delevery Date</th>
86                     <th>User Name</th>
87                     <th>User Mobile</th>
88                     <th>User Email</th>
89                     <th>Edit</th>
90                 </tr>
91                 <tr>
92                     <?php include (
"../inc/connect.inc.php");
93                     $query =
"SELECT * FROM orders ORDER BY id DESC";
94                     $run = mysql_query($query);
95                     
while ($row=mysql_fetch_assoc($run)) {
96                         $oid = $row[
'id'];
97                         $ouid = $row[
'uid'];
98                         $opid = $row[
'pid'];
99                         $oquantity = $row[
'quantity'];
100                         $oplace = $row[
'oplace'];
101                         $omobile = $row[
'mobile'];
102                         $odstatus = $row[
'dstatus'];
103                         $odate = $row[
'odate'];
104                         $ddate = $row[
'ddate'];
105                         
//getting user info
106                         $query1 =
"SELECT * FROM user WHERE id='$ouid'";
107                         $run1 = mysql_query($query1);
108                         $row1=mysql_fetch_assoc($run1);
109                         $ofname = $row1[
'firstName'];
110                         $oumobile = $row1[
'mobile'];
111                         $ouemail = $row1[
'email'];
112
113                         
//product info
114                         $query2 =
"SELECT * FROM products WHERE id='$opid'";
115                         $run2 = mysql_query($query2);
116                         $row2=mysql_fetch_assoc($run2);
117                         $opcate = $row2[
'category'];
118                         $opitem = $row2[
'item'];
119                         $oppicture = $row2[
'picture'];
120                         $oprice = $row2[
'price'];
121
122                     
123                      ?>
124                     <th><?php echo $oid; ?></th>
125                     <th><?php echo $ouid; ?></th>
126                     <th><?php echo $opid; ?></th>
127                     <th><?php echo
''.$oquantity.' * '.$oprice.' = '.$oquantity*$oprice.''; ?></th>
128                     <th><?php echo $oplace; ?></th>
129                     <th><?php echo $omobile; ?></th>
130                     <th><?php echo $odstatus; ?></th>
131                     <th><?php echo $odate; ?></th>
132                     <th><?php echo $ddate; ?></th>
133
134                     <th><?php echo $ofname; ?></th>
135                     <th><?php echo $oumobile; ?></th>
136                     <th><?php echo $ouemail; ?></th>
137                     <th><?php echo
'<div class="home-prodlist-img"><a href="editorder.php?eoid='.$oid.'">
138                                     <img src=
"../image/product/'.$opitem.'/'.$oppicture.'" class="home-prodlist-imgi" style="height: 75px; width: 75px;">
139                                     </a>
140                                 </div>
' ?></th>
141                 </tr>
142                 <?php } ?>
143             </table>
144         </div>
145     </body>
146 </html>


Gõ tìm kiếm nhanh...